package com.chinda.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.chinda.common.config.cache.CacheManagerConfig;
import com.chinda.common.constants.CacheConstant;
import com.chinda.common.page.RPage;
import com.chinda.modules.sys.entity.SysConfigEntity;
import com.chinda.modules.sys.qo.SysConfigQO;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;

/**
 * 系统配置信息表
 *
 * @author chinda
 * @date 2021-06-16 05:52:51
 */
@CacheConfig(cacheNames = {CacheConstant.SYS_CONFIG_CACHE}, cacheManager = CacheManagerConfig.CacheManagerNames.EHCACHE_CACHE_MANAGER)
public interface SysConfigService extends IService<SysConfigEntity> {

    /**
     * 获取分页信息
     * @param qo
     * @return
     */
    RPage page(SysConfigQO qo);

    /**
     * 根据参数key获取参数
     * @param paramKey
     * @return
     */
    @Cacheable(value = CacheConstant.SYS_CONFIG_CACHE, key = "#paramKey")
    SysConfigEntity getByParamKey(String paramKey);

}

